package com.example.mybatisplusdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.mybatisplusdemo.model.domain.User;
import com.example.mybatisplusdemo.model.dto.YearUserActivityDTO;
import com.example.mybatisplusdemo.model.dto.YesrCountDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lxp
 * @since 2025-07-04
 */
public interface UserMapper extends BaseMapper<User> {

    Page<User> listUsers(Page<User> page, @Param("user") User user);

    boolean freeById(@Param("id") Long id);
    boolean unfreezeById(@Param("id") Long id);

    List<YesrCountDTO> getAnnualRegistrations(@Param("startYear") Integer startYear, @Param("endYear") Integer endYear);

    List<YearUserActivityDTO> getUserActivityByYear(@Param("startYear") Integer startYear, @Param("endYear") Integer endYear);

    Integer getPrivacySettingsById(@Param("userId") Long userId);
}
